package com.ykdl.member.kid.image;

import android.content.Context;

import com.ykdl.member.kid.R;

public class ImageOptionsFactory {
	private static ImageOptions bigPortraitOptions;
	private static ImageOptions smallPortraitOptions;
	private static final Object lock = new Object();

	public static ImageOptions getBigPortraitOptions(Context context) {
		synchronized (lock) {
			if (bigPortraitOptions == null) {
				bigPortraitOptions = new ImageOptions();
				bigPortraitOptions.setWidth((int) context.getResources()
						.getDimension(R.dimen.portrait_width));
				bigPortraitOptions.setHeight((int) context.getResources()
						.getDimension(R.dimen.portrait_height));
			}
		}
		return bigPortraitOptions;
	}

	public static ImageOptions getSmallPortraitOptions(Context context) {
		synchronized (lock) {
			if (smallPortraitOptions == null) {
				smallPortraitOptions = new ImageOptions();
				smallPortraitOptions.setWidth((int) context.getResources()
						.getDimension(R.dimen.portrait_small_width));
				smallPortraitOptions.setHeight((int) context.getResources()
						.getDimension(R.dimen.portrait_small_height));
			}
		}
		return smallPortraitOptions;
	}
}
